package com.zhengsanming.josn;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class FastJson {
    public static void main(String[] args) {
        User user = new User();
        user.setId(1);
        user.setUsername("张三");
        user.setPassword("21213344");

        String s = JSON.toJSONString(user);
        System.out.println(s);
        JSONObject jsonObject = JSON.parseObject("{\"id\":1,\"password\":\"21213344\",\"username\":\"张三\"}");
        System.out.println(jsonObject);
    }
}

